package com.ocom.ugcapi.client;

import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.constant.WxServiceUrl;
import com.ocom.common.entity.human.EntityDeptInfo;
import com.ocom.common.entity.human.EntityRoommateInfo;
import com.ocom.common.entity.master.EntityWechatPerInfo;
import com.ocom.common.request.human.FeatureRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PersonVo;
import com.ocom.common.vo.human.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "human")
public interface HumanClientService {

//

    /**
     * 添加微信用户
     * @param wechatPerInfo
     */
    @PostMapping(HumanServiceUrl.URLP_HUAMN_ADD_WXPER)
    Result addWxper(@RequestBody EntityWechatPerInfo wechatPerInfo);

    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody Map<String,Object> map);

    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody UserInfoVo userInfoVo);
    /**
     * 获取人员信息 getPersonInfo
     * */
    @GetMapping(HumanServiceUrl.URL_GetPersonInfo)
    public Result<UserInfoYkmVo> getPersonInfo(@RequestParam("comId") Long comId,@RequestParam("pId") Long pId);

    /**
     * 根据手机号身份证获取人员信息 getPersonInfoByPhoneOrCard
     * */
    @PostMapping(HumanServiceUrl.URL_GetPersonInfoByPhoneOrCard)
    public Result  GetPersonInfoByPhoneOrCard(@RequestBody Map<String,Object> map);


    /**
     * 获取微信人员(getWxPerson)
     * */
    @GetMapping(HumanServiceUrl.URL_GetWxPerson)
    public Result<EntityWechatPerInfo> GetWxPerson(@RequestParam("appId")String appId,@RequestParam("openId")String openId,
                              @RequestParam("comId")Long comId);

    /**
     * 删除微信绑定人员(delWxPerson)
     * */
    @PostMapping(HumanServiceUrl.URL_DelWxPerson)
    public Result DelWxPerson(@RequestParam("appId")String appId,@RequestParam("openId")String openId);


    //消费的用户信息
    @PostMapping(HumanServiceUrl.URL_getXfUserInfo)
    public Result<XfUserInfoVo> getXfUserInfo(@RequestParam("comId")Long comId, @RequestParam("pId")Long pId);

//    @PostMapping(HumanServiceUrl.URL_getXfUserInfo)
//    public Result getPersonDetail(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId);


    @PostMapping(WxServiceUrl.URL_modifyPwd)
    public Result modifyPwd(@Validated @RequestBody PersonVo personVo);

    @PostMapping(WxServiceUrl.URL_modifyPhoto)
    public Result modifyPhoto(@RequestBody PersonVo personVo);


    @PostMapping(HumanServiceUrl.URL_PersonnelAddPerson)
    public Result AddPerson(@RequestBody PersonVo personVo);


    @PostMapping(HumanServiceUrl.URLP_checkUnique)
    public Result checkUnique(@RequestParam("companyId")Long companyId,
                              @RequestParam("code")String code,
                              @RequestParam("phone")String phone);

    @PostMapping(HumanServiceUrl.URL_Department_GetDeptList)
    public Result<List<EntityDeptInfo>> getDeptList(@RequestParam("companyId") Long companyId, @RequestParam("deptId") Long deptId, @RequestParam("show") Integer show);


    @PostMapping(HumanServiceUrl.URL_GetRoommateList)
    public Result GetRoommateList(@Validated @RequestBody GetRoommateListVo getRoommateListVo);


    @PostMapping(HumanServiceUrl.URL_AddRoommate)
    public Result AddRoommate(@Validated @RequestBody EntityRoommateInfo entityRoommateInfo);


    @PostMapping(HumanServiceUrl.URL_RemoveRoommate)
    public Result RemoveRoommate(@Validated @RequestBody RemoveRoommateVo removeRoommateVo);

    @PostMapping(HumanServiceUrl.URL_addRoommateCode)
    public Result addRoommateCode(@Validated @RequestBody AddRoommateCodeVo request);

    /**修改人员信息*/
    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@Validated @RequestBody PersonVo personVo);

    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePersonNotCheckPhone)
    public Result UpdatePersonNotCheckPhone(@Validated @RequestBody PersonVo personVo);

    @PostMapping(HumanServiceUrl.URL_PersonnelFeature)
    public Result feature(@RequestBody FeatureRequest request);


}
